home *** CD-ROM | disk | FTP | other *** search
- ;AGA Mirror Demo
- ;---------------
- ;Demo of the mirroring effect. When this effect is combined with a
- ;decrease in palette values at the same line, you can create the illusion of
- ;water.
- ;
- ;Use the mouse to move the mirror up and down. LMB exits.
-
- opt o+
-
- INCLUDE "exec/exec_lib.i"
- INCLUDE "games/games_lib.i"
- INCLUDE "games/games.i"
-
- CALL MACRO
- jsr _LVO\1(a6)
- ENDM
-
- SECTION "MirrorDemo",CODE
-
- ;===========================================================================;
- ; INITIALISE DEMO
- ;===========================================================================;
-
- Start: MOVEM.L A0-A6/D1-D7,-(SP)
- move.l ($4).w,a6
- lea GMS_Name(pc),a1
- moveq #$00,d0
- CALL OpenLibrary
- move.l d0,GMS_Base
- beq Quit
-
- move.l GMS_Base(pc),a6
- CALL SetUserPri
-
- move.l GMS_Base(pc),a6 ;Initialise our screen.
- lea ScreenStruct(pc),a0
- CALL Add_Screen
- tst.l d0
- bne.s Error
-
- move.l SS_MemPtr1(a0),a1 ;a1 = Destination.
- lea PackedPicFile(pc),a0 ;a0 = File Name.
- moveq #$00,d0 ;d0 = Password
- CALL SmartLoad
- tst.l d0
- beq.s ReturnToDOS
-
- lea ScreenStruct(pc),a0 ;Now show the screen/pic.
- CALL Show_Screen
-
- moveq #JPORT1,d0 ;Initialise Mouse Port 1.
- CALL Read_Mouse
-
- ;===========================================================================;
- ; MAIN CODE
- ;===========================================================================;
-
- Loop: CALL Wait_OSVBL
- CALL Update_RasterLines
-
- moveq #JPORT1,d0
- CALL Read_Mouse
- ext.w d0
- add.w d0,RasterList+2
-
- .chk129 cmp.w #129,RasterList+2
- bgt.s .chk256
- move.w #129,RasterList+2
-
- .chk256 cmp.w #255,RasterList+2
- blt.s .chklmb
- move.w #255,RasterList+2
-
- .chklmb btst #MB_LMB,d0
- beq.s Loop
-
- moveq #$00,d0 ;d0 = FadeState, initialise to 0.
- moveq #4,d1 ;d1 = Speed of fade.
- Fade: CALL Wait_OSVBL
- CALL B24_FadeToBlack ;Do the fade routine.
- tst.w d0 ;Has the fade finished yet?
- bne.s Fade ;If not, keep going.
-
- ;===========================================================================;
- ; RETURN TO DOS
- ;===========================================================================;
-
- ReturnToDOS:
- move.l GMS_Base(pc),a6
- lea ScreenStruct(pc),a0
- CALL Delete_Screen ;Give back screen memory etc.
- Error: move.l GMS_Base(pc),a1
- move.l ($4).w,a6
- CALL CloseLibrary
- Quit: MOVEM.L (SP)+,A0-A6/D1-D7
- moveq #$00,d0
- rts
-
- ;===========================================================================;
- ; DATA
- ;===========================================================================;
-
- GMS_Name:
- dc.b "games.library",0
- even
- GMS_Base:
- dc.l 0
-
- AMT_PLANES = 7
-
- ScreenStruct:
- dc.l "GSV1",0
- dc.l 0,0,0 ;Screen_Mem1/2/3
- dc.l 0 ;Screen link.
- dc.l Palette ;Address of screen palette.
- dc.l RasterList ;Address of rasterlist.
- dc.l 0 ;Amt of colours in palette.
- dc.w 320,256,320,256 ;Screen & Pic Height/Width.
- dc.w AMT_PLANES ;Amt_Planes
- dc.w 0,0 ;X/Y screen offset.
- dc.w 0,0 ;X/Y picture offset.
- dc.l 0 ;Special attributes.
- dc.w LORES|COL24BIT ;Screen mode.
- dc.b INTERLEAVED ;Screen type
- dc.b 0 ;Reserved
- even
-
- RasterList:
- WAITLINE 164
- MIRROR
- RASTEND
-
- Palette dc.l $000000,$FFFFFF,$FAF5F2,$FAE8E7
- dc.l $EEDED5,$E8D4C8,$DDC0AF,$D7B5A2
- dc.l $D1AC96,$DCA491,$CBA38B,$C5997E
- dc.l $BD8E74,$B5846A,$AD7A5F,$A57056
- dc.l $9D674D,$955D44,$8C533B,$844B34
- dc.l $7C432D,$743B26,$6C3320,$642D1B
- dc.l $5C2616,$532010,$4A1D0C,$411A09
- dc.l $381606,$2F1204,$260F02,$1D0C00
- dc.l $AC783A,$A67139,$A06C39,$986638
- dc.l $995F36,$906037,$8C5C36,$945733
- dc.l $865735,$905030,$7E5133,$8D4B2E
- dc.l $764B31,$6E4630,$8A462D,$64412B
- dc.l $5D3D27,$593A24,$543822,$50351F
- dc.l $4B341D,$47301A,$592218,$402D17
- dc.l $382813,$3B2007,$302310,$2B200D
- dc.l $331100,$430907,$3C0504,$2E0202
- dc.l $B48038,$B7743D,$AE6350,$A85D4A
- dc.l $A35644,$9E503E,$994A39,$944534
- dc.l $9F4336,$8E3F30,$87412B,$87382A
- dc.l $823628,$803226,$792C21,$72251C
- dc.l $E1AB98,$DBA28C,$D79C89,$D29582
- dc.l $CD8D7A,$C88672,$C27E6B,$BD7764
- dc.l $B8705D,$B36A57,$BB5244,$AD4A3D
- dc.l $C8594A,$7F7444,$847D49,$67271E
- dc.l $6C2219,$651D15,$5E1711,$57130E
- dc.l $500F0B,$4A0C09,$350303,$270000
- dc.l $89874E,$8C8E53,$8C9358,$8E9D62
- dc.l $C6904A,$9AA467,$CD9E51,$AFAE6F
- dc.l $E3D765,$D5AE58,$BCAD78,$C1AC7C
- dc.l $CBAA82,$D5A588,$EAA09B,$ECA7A2
- dc.l $EDADA9,$EFB5B1,$F0BBB8,$F2C2BF
- dc.l $F4CBC8,$F5D1CF,$F7D9D7,$FDF7F7
-
- PackedPicFile:
- dc.b "GAMESLIB:data/Yattering128.pak",0
- even
-
-